package adv6;

import java.util.Calendar;
//0：输出今天的日期和周几，周几用汉字表示
public class Work {
    public static void main(String[] args) {
        Calendar c = Calendar.getInstance();
        System.out.println(c);
        //获得日期的各个部分
        System.out.print(c.get(Calendar.YEAR) + "年");
        System.out.print(c.get(Calendar.MONTH) + "月");
        System.out.println(c.get(Calendar.DAY_OF_MONTH) + "日");
        int day = c.get(Calendar.DAY_OF_WEEK);
        if (day == 1) System.out.println("周日");
        if (day == 2) System.out.println("周一");
        if (day == 3) System.out.println("周二");
        if (day == 4) System.out.println("周三");
        if (day == 5) System.out.println("周四");
        if (day == 6) System.out.println("周五");
        if (day == 7) System.out.println("周六");
    }
}